package ClassExercise1;

import java.io.*;

public class Exercise5 {
    public static void main(String[] args) throws IOException {
        FileOutputStream ifw = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\5.txt");
        FileInputStream iso = new FileInputStream("C:\\Users\\Administrator\\Desktop\\5.txt");

        DataInputStream s = new DataInputStream(iso);
        DataOutputStream s1 = new DataOutputStream(ifw);
        String str= "陈俊华";
        int age = 18;
        boolean isMale =true;
        s1.writeUTF(str);
        s1.flush();
        s1.writeInt(age);
        s1.flush();
        s1.writeBoolean(isMale);
        s1.flush();
     String name =s.readUTF();
        System.out.println(name);
        int age1 = s.readInt();
        System.out.println(age);
        boolean isf = s.readBoolean();
        System.out.println(isf);

    }
}
